<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;

class FamousTeacher extends Model
{

    protected $table = 'xyj_famous_teachers';

    protected $fillable = [
        'teacher_user_id',
        'sort',
        'school_info'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function file()
    {
        return $this->belongsToMany(File::class, 'xyj_famous_teacher_has_files', 'famous_teacher_id', 'files_id')->withPivot('point_url', 'title');
    }

    public function teacher()
    {
        return $this->belongsTo(Teacher::class, 'teacher_user_id' , 'user_id');
    }



}
